
import { get, post } from "./api"
import { ContentListSchema, ContentSchema, ContentTypeSchema, Response, SavedSchema } from "./schema"

export const getContentTypeList = () : Promise<Response<ContentTypeSchema[]>> => {
	return get('/content/typeList')
}

export const getContentList = (secret_id : number) : Promise<Response<ContentListSchema>> => {
	return get('/content/list', {
		secret_id
	})
}

export const getContentInfo = (id : number) : Promise<Response<ContentSchema>> => {
	return post('/content/info', {
		id
	})
}

export const saveContent = (content : ContentSchema) : Promise<Response<SavedSchema>> => {
	return post('/content/save', content);
}